package cn.meibang.aggragation.beauty.controller;

import cn.apestar.agg.common.security.BaseAuthController;
import cn.meibang.common.beauty.api.IBcoUserOrderAPIService;
import cn.meibang.common.beauty.provider.response.BcoUserCountStatsResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by admin on 2017-6-29.
 */
@RestController
@RequestMapping("/bcoUser")
public class BcoUserController extends BaseAuthController {

    @Autowired
    private IBcoUserOrderAPIService bcoUserOrderAPIService;

    @RequestMapping(value = "/countOrderUser")
    public BcoUserCountStatsResponse countOrderUser(@RequestParam(value = "consultant_id", required = false) Long consultantId) {
        if (consultantId == null) {
            consultantId = getCurrentUserId();
        }
        return bcoUserOrderAPIService.countOrderUser(consultantId);
    }

}
